import { defineStore } from 'pinia'
import { useThemeDSL } from '../utils/themeDSL'

export interface AppState {
  appName: string
  sidebarCollapsed: boolean
  currentMicroApp: string | null
}

export const useAppStore = defineStore('app', {
  state: (): AppState => ({
    appName: '效率工具平台',
    sidebarCollapsed: false,
    currentMicroApp: null
  }),
  
  getters: {
    getAppName: (state) => state.appName,
    getSidebarStatus: (state) => state.sidebarCollapsed,
    getCurrentMicroApp: (state) => state.currentMicroApp
  },
  
  actions: {
    toggleSidebar() {
      this.sidebarCollapsed = !this.sidebarCollapsed
    },
    setCurrentMicroApp(name: string | null) {
      this.currentMicroApp = name
    }
  }
}) 